using System;
using Csla;

namespace ENT.GP.Core.Proyecto
{
    [Serializable]
    public class ProyectoCriterio : BusinessBase<ProyectoCriterio>
    {
        #region Business Methods

        private static PropertyInfo<int> SupervisionIdProperty = RegisterProperty<int>(o => o.SupervisionId, "Name");
        public int SupervisionId
        {
            get { return GetProperty(SupervisionIdProperty); }
            set { SetProperty(SupervisionIdProperty, value); }
        }

        private static PropertyInfo<int> ProgramaIdProperty = RegisterProperty<int>(o => o.ProgramaId, "Name");
        public int ProgramaId
        {
            get { return GetProperty(ProgramaIdProperty); }
            set { SetProperty(ProgramaIdProperty, value); }
        }

        private static PropertyInfo<int> EjeIdProperty = RegisterProperty<int>(o => o.EjeId, "Name");
        public int EjeId
        {
            get { return GetProperty(EjeIdProperty); }
            set { SetProperty(EjeIdProperty, value); }
        }

        private static PropertyInfo<int> TipoIdProperty = RegisterProperty<int>(o => o.TipoId, "Name");
        public int TipoId
        {
            get { return GetProperty(TipoIdProperty); }
            set { SetProperty(TipoIdProperty, value); }
        }

        private static PropertyInfo<int> EstadoIdProperty = RegisterProperty<int>(o => o.EstadoId, "Name");
        public int EstadoId
        {
            get { return GetProperty(EstadoIdProperty); }
            set { SetProperty(EstadoIdProperty, value); }
        }

        private static PropertyInfo<string> NombreProperty = RegisterProperty<string>(o => o.Nombre, "Name");
        public string Nombre
        {
            get { return GetProperty(NombreProperty); }
            set { SetProperty(NombreProperty, value); }
        }

        public bool BuscaPerfiles { get; set; }

        #endregion

        #region Validation Rules

        protected override void AddBusinessRules()
        {
            // TODO: add validation rules
            //ValidationRules.AddRule(RuleMethod, "");
        }

        #endregion

        #region Authorization Rules

        protected override void AddAuthorizationRules()
        {
            // TODO: add authorization rules
            //AuthorizationRules.AllowWrite("Name", "Role");
        }

        private static void AddObjectAuthorizationRules()
        {
            // TODO: add authorization rules
            //AuthorizationRules.AllowEdit(typeof(ProyectoCriterio), "Role");
        }

        #endregion

        #region Factory Methods

        public static ProyectoCriterio NewProyectoCriterio()
        {
            return DataPortal.Create<ProyectoCriterio>();
        }

        public static ProyectoCriterio GetEditableRoot(int id)
        {
            return DataPortal.Fetch<ProyectoCriterio>(
              new SingleCriteria<ProyectoCriterio, int>(id));
        }

        public static void DeleteEditableRoot(int id)
        {
            DataPortal.Delete(new SingleCriteria<ProyectoCriterio, int>(id));
        }

        private ProyectoCriterio()
        { /* Require use of factory methods */ }

        #endregion

        
    }

    [Serializable]
    public class DatosCriteria : BusinessBase<DatosCriteria>
    {
        #region Business Methods

        public int EntidadId { get; set; }

        private static PropertyInfo<int> TipoIdProperty = RegisterProperty<int>(o => o.TipoId, "Name");
        public int TipoId
        {
            get { return GetProperty(TipoIdProperty); }
            set { SetProperty(TipoIdProperty, value); }
        }

        
        private static PropertyInfo<string> NombreProperty = RegisterProperty<string>(o => o.Nombre, "Name");
        public string Nombre
        {
            get { return GetProperty(NombreProperty); }
            set { SetProperty(NombreProperty, value); }
        }

        

        #endregion

        #region Validation Rules

        protected override void AddBusinessRules()
        {
            // TODO: add validation rules
            //ValidationRules.AddRule(RuleMethod, "");
        }

        #endregion

        #region Authorization Rules

        protected override void AddAuthorizationRules()
        {
            // TODO: add authorization rules
            //AuthorizationRules.AllowWrite("Name", "Role");
        }

        private static void AddObjectAuthorizationRules()
        {
            // TODO: add authorization rules
            //AuthorizationRules.AllowEdit(typeof(ProyectoCriterio), "Role");
        }

        #endregion

        #region Factory Methods

        public static DatosCriteria NewProyectoCriterio()
        {
            return DataPortal.Create<DatosCriteria>();
        }

        public static DatosCriteria GetEditableRoot(int id)
        {
            return DataPortal.Fetch<DatosCriteria>(
              new SingleCriteria<DatosCriteria, int>(id));
        }

        public static void DeleteEditableRoot(int id)
        {
            DataPortal.Delete(new SingleCriteria<DatosCriteria, int>(id));
        }

        private DatosCriteria()
        { /* Require use of factory methods */ }

        #endregion


    }
    [Serializable]
    public class GraficoCriteria : BusinessBase<GraficoCriteria>
    {
        #region Business Methods

        public int EntidadId { get; set; }
        private static PropertyInfo<int> TipoIdProperty = RegisterProperty<int>(o => o.TipoId, "Name");
        public int TipoId
        {
            get { return GetProperty(TipoIdProperty); }
            set { SetProperty(TipoIdProperty, value); }
        }

        private static PropertyInfo<string> NombreProperty = RegisterProperty<string>(o => o.Nombre, "Name");
        public string Nombre
        {
            get { return GetProperty(NombreProperty); }
            set { SetProperty(NombreProperty, value); }
        }

        public bool BuscaPerfiles { get; set; }

        #endregion

        #region Validation Rules

        protected override void AddBusinessRules()
        {
            // TODO: add validation rules
            //ValidationRules.AddRule(RuleMethod, "");
        }

        #endregion

        #region Authorization Rules

        protected override void AddAuthorizationRules()
        {
            // TODO: add authorization rules
            //AuthorizationRules.AllowWrite("Name", "Role");
        }

        private static void AddObjectAuthorizationRules()
        {
            // TODO: add authorization rules
            //AuthorizationRules.AllowEdit(typeof(ProyectoCriterio), "Role");
        }

        #endregion

        #region Factory Methods

        public static GraficoCriteria NewProyectoCriterio()
        {
            return DataPortal.Create<GraficoCriteria>();
        }

        public static GraficoCriteria GetEditableRoot(int id)
        {
            return DataPortal.Fetch<GraficoCriteria>(
              new SingleCriteria<GraficoCriteria, int>(id));
        }

        public static void DeleteEditableRoot(int id)
        {
            DataPortal.Delete(new SingleCriteria<GraficoCriteria, int>(id));
        }

        private GraficoCriteria()
        { /* Require use of factory methods */ }

        #endregion


    }
}
